<!-- MRGB09			（ 团体综合成绩带明细7轮） -->
<template>
  <div>
    <div class="item-info">
      <div
        :class="['single-item', item.flag ? 'active-item' : '']"
        v-for="(item, index) in singleItemList"
        :key="index"
      >
        <div>{{ item.name }}</div>
        <div class="item-logo">
          <img :src="item.logo" alt="" />
        </div>
      </div>
      <div class="single-item-info">
        <div class="info-line1">
          <div>{{ gameTitle }}</div>
          <div class="venue">{{ venueName }}</div>
        </div>
        <div class="info-line2">
          <div class="report-name">综合成绩公告</div>
          <div>{{ gameTime }}</div>
        </div>
      </div>
    </div>
    <div class="score-table-data" style="width: 100%;">
      <el-table
        :data="reportData"
        style="width: 100%"
        stripe
        border
        :header-cell-style="{ 'text-align': 'center' }"
        :cell-style="{ 'text-align': 'center' }"
      >
        <template v-for="(item, index) in tableHeader">
          <div>
            <el-table-column :label="item.label" v-if="!item.prop" width="auto" :key="index">
              <div>
                <template v-for="(row, index1) in item.subCol">
                  <el-table-column :label="row.label" :prop="row.prop" width="60" :key="index1">
                  </el-table-column>
                </template>
              </div>
            </el-table-column>
            <el-table-column
              v-else
              :label="item.label"
              :prop="item.prop"
              width="auto"
              :fixed="item.fixed"
            >
            </el-table-column>
          </div>
        </template>
      </el-table>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
export default {
  created() {
    this.venueName = this.$route.query.venueName
    this.gameTime = this.$route.query.gameTime
    this.gameTitle = this.$route.query.gameTitle
    this.filePath = this.$route.query.filePath
    this.getReportData()
  },
  props: {},
  data() {
    return {
      tableHeader: [
        { prop: 'Rank', label: '名次', fixed: 'left' },
        { prop: 'Order', label: '编号' },
        { prop: 'Name', label: '姓名' },
        { prop: 'Team', label: '单位' },
        {
          prop: '',
          label: '第一轮',
          subCol: [
            { prop: 'Oppo1', label: '对手分' },
            { prop: 'Score1', label: '积分' }
          ]
        },
        {
          prop: '',
          label: '第二轮',
          subCol: [
            { prop: 'Oppo2', label: '对手分' },
            { prop: 'Score2', label: '积分' }
          ]
        },
        {
          prop: '',
          label: '第三轮',
          subCol: [
            { prop: 'Oppo3', label: '对手分' },
            { prop: 'Score3', label: '积分' }
          ]
        },
        {
          prop: '',
          label: '第四轮',
          subCol: [
            { prop: 'Oppo4', label: '对手分' },
            { prop: 'Score4', label: '积分' }
          ]
        },
        {
          prop: '',
          label: '第五轮',
          subCol: [
            { prop: 'Oppo5', label: '对手分' },
            { prop: 'Score5', label: '积分' }
          ]
        },
        {
          prop: '',
          label: '第六轮',
          subCol: [
            { prop: 'Oppo6', label: '对手分' },
            { prop: 'Score6', label: '积分' }
          ]
        },
        {
          prop: '',
          label: '第七轮',
          subCol: [
            { prop: 'Oppo7', label: '对手分' },
            { prop: 'Score7', label: '积分' }
          ]
        },
        {
          prop: '',
          label: '第八轮',
          subCol: [
            { prop: 'Oppo8', label: '对手分' },
            { prop: 'Score8', label: '积分' }
          ]
        },
        {
          prop: '',
          label: '第九轮',
          subCol: [
            { prop: 'Oppo9', label: '对手分' },
            { prop: 'Score9', label: '积分' }
          ]
        },
        {
          prop: '',
          label: '第十轮',
          subCol: [
            { prop: 'Oppo10', label: '对手分' },
            { prop: 'Score10', label: '积分' }
          ]
        },
        {
          prop: '',
          label: '第十一轮',
          subCol: [
            { prop: 'Oppo11', label: '对手分' },
            { prop: 'Score11', label: '积分' }
          ]
        },
        { prop: 'Score', label: '积分' },
        { prop: 'HB1', label: '对手分' },
        { prop: 'HB2', label: '中间对手分' },
        { prop: 'WinCount', label: '胜局数', fixed: 'right' }
      ],
      tableData: [
        {
          NUMBER: '1 ',
          NAME: '杨一',
          TEAM: '河北',
          Oppo1: '2',
          Score1: '0',
          MATCH1: '0',
          Oppo2: '22', //对手分
          Score2: '', //局
          MATCH2: '2', //场
          Oppo3: '21',
          Score3: '2',
          MATCH3: '4',
          Oppo4: '6',
          Score4: '0',
          MATCH4: '4',
          Oppo5: '10',
          Score5: '2',
          MATCH5: '4',
          Oppo6: '17',
          Score6: '0',
          Oppo7: '17',
          Score7: '0',
          OppoAll: '25',
          HB1: '63',
          HB2: '22',
          HB3: null,
          RANK: '19',
          MEMO: null
        }
      ],
      filePath: '',
      venueName: '',
      gameTime: '',
      gameTitle: '',
      singleItemList: [
        {
          name: '五子棋',
          logo: require('@/assets/img/daily/GB.png'),
          flag: true
        }
      ]
    }
  },
  watch: {},
  computed: {
    ...mapState({
      reportData: state => state.schedule.reportData
    })
  },
  filters: {},
  components: {},
  methods: {
    getReportData() {
      this.$store
        .dispatch('getReportData', this.filePath + '.txt')
        .then(_ => {})
        .catch(error => {
          console.log(error)
        })
    }
  }
}
</script>
<style scoped lang="scss">
@import '@/assets/scss/item.scss';
</style>
